package es.cea.tags;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;

public class TablitaTag extends TagSupport{


	private String celdas;

	
	@Override
	public int doStartTag() throws JspException {
		
		pageContext.getSession();
		String[] aCeldas = new String[celdas.split(",").length-1];
		aCeldas = celdas.split(",");
		
		JspWriter out = pageContext.getOut();
		try {
			out.println("<table border = '1'> <tr>");
			
			for (int i = 0;i<aCeldas.length;i++){
				out.println("<td>" + aCeldas[i].toString() +" </td> ");
			}
			out.println(" </tr></table>");
		} catch (IOException e) {
			throw new JspException(e);
		}
		return SKIP_BODY;
	}
	
	public String getCeldas() {
		return celdas;
	}

	public void setCeldas(String celdas) {
		this.celdas = celdas;
	}
	
	
}
